
env = Environment()
env[ 'CCFLAGS' ] = '-g -O2 -fPIC  -D_THREAD_SAFE -pthread -Wall -Wno-sign-compare'
env[ 'CPPPATH' ] = [ '../include', '../../include', '../../../include', '/home/s/include', ]
env[ 'CPPFLAGS' ] = []
env[ 'LIBDIR' ] = '../../lib'
env[ 'LIBPATH' ] = [ '../lib','../../lib','../../../lib','/home/s/lib/static', ]
env[ 'LIBS' ] = ['sakcab_packet','bocat_common','protobuf','boost_program_options-mt','boost_filesystem-mt','boost_system-mt','boost_thread-mt','crypto','z','pthread',]

libdir = '../../lib'
incdir = '../../include'

libfile = env.StaticLibrary('sakcab_client', ['client.cpp', 'broker.cpp'])
libfilename = str(libfile[0])

env.Command( '../lib/%s' % libfilename, libfilename, Copy("$TARGET","$SOURCE") )
env.Command( '%s/%s' % (libdir, libfilename), libfilename, Copy("$TARGET","$SOURCE") )

head_filename = 'client.hpp'
env.Command( '%s/sakcab/%s' % (incdir, head_filename), head_filename, Copy("$TARGET","$SOURCE") )


programs = env.Program( 'client', [ 'posix_main.cpp', libfilename ] )
program = str( programs[0] )

for bin_dir in ('../bin','../../bin') :
    env.Command( '%s/%s' % (bin_dir, program), program, Copy("$TARGET","$SOURCE") )

